<template>
	<view class="box">
		<view class="header">
			<view class="iconfont icon-fanhui" @click="fanhui">返回</view>
			<view class="">新增</view>
			<view class=""> </view>
		</view>
	</view>
	<view class="shuzishurukuang">
		<view class="wenzibu">
			<view class="">申请月份</view>
		</view>
		<view class="weui-cells weui-cells_after-title">
			<view class="weui-cell weui-cell_input">
				<input class="weui-input" type="text"  v-model="yue"  placeholder="请选择" />
			</view>
		</view>
	</view>
	<view class="shenpiA">
		<view class="shenpi">申请理由</view>
		<view class="weui-cells weui-cells_after-title">
			<view class="weui-cell weui-cell_input">
				<view class="weui-cell__bd" style="margin: 30rpx 0">
					<input class="qingsr" name="input"  type="text"  v-model="liyou"    placeholder="请输入" />
				</view>
			</view>
		</view>
	</view>
	<text class="shancghuan">上传附件（最多10张)</text>
	<view class="tupian">
		<image src="" mode="">a</image>
		<image src="" mode="">b</image>
		<image src="" mode="">c</image>
	</view>
	<view class="tijiao">
		<button @click="tianjia">提交</button>
	</view>
</template>

<script>
	import {
			ref,
			computed,
			reactive,
			toRefs
		} from 'vue'
	import http from '../../../utils/http.js'
		export default {
			setup() {
				let data = reactive({
					yue:'',
					liyou:'',
					fujain1:'',
				
				tianjia(){
					let date=new Date()	
					  const year = date.getFullYear()
					  const month = date.getMonth() + 1
					  const day = date.getDate()
					  const hour = date.getHours()
					  const minute = date.getMinutes()
					  const second = date.getSeconds()
				     let time=`${[year, month, day].join('-')} ${[hour, minute, second].join(':')}`
					
			
					http({
						url: "/miniwatermeter/getAddyiyi",
						method: "post",
						data:{
							yue:data.yue, 
							liyou:data.liyou,
							fujain1:1,	
							time:time,	
						}		
					}).then((res) => {
					if(res.data.code==200){
						uni.navigateTo({
							url: '../yiyishenqing/yiyishenqing'
						})
					}			
					 })		   
				}
				});
				return {
					...toRefs(data)
				};
			},
			onLoad() {},
			methods: {
				fanhui:function(){
					uni.navigateBack({
						delta:1
					})
				}
			},
		}
</script>

<style lang="scss">
	@import url("~@/static/xzafont/font/iconfont.css");

	.header .icon-fanhui {
		font-size: 35rpx;
	}

	.box {
		font-size: 35rpx;
	}

	.header {
		display: flex;
		justify-content: space-between;
		/* background-color: #FFFFFF; */
		line-height: 90rpx;
		margin: 0 30rpx;
		border-bottom: 1rpx solid #F8F8F8;
	}

	.shenpiA {
		font-size: 35rpx;
		margin-top: 20rpx;
	}

	.shenpi {
		margin-left: 60rpx;
	}

	.qingsr {
		width: 655rpx;
		height: 200rpx;
		margin: 0 30rpx;
		padding-left: 30rpx;
		border-radius: 20rpx;
		border: 1rpx solid #E4E4E4;
	}

	.shuzishurukuang {
		display: flex;
		font-size: 35rpx;
		margin: 20rpx 20rpx;
		align-content: stretch;
		border: 1rpx solid #E4E4E4;
	}

	.wenzibu {
		display: flex;
		width: 180rpx;
		height: 90rpx;
		justify-content: center;
		align-items: center;
		flex-wrap: wrap;
		margin: 10rpx 20rpx;
	}

	.weui-cells {
		display: flex;
		align-items: center;
	}

	.shancghuan {
		color: #E4E4E4;
		font-size: 35rpx;
		margin-left: 20rpx;
	}

	.tupian {
		display: flex;
	}

	.tupian image {
		width: 200rpx;
		height: 200rpx;
		margin: 20rpx 20rpx;
		border: 1rpx solid #E4E4E4;
	}
	.tijiao {
		display: flex;
		justify-content: center;
	}
	
	.tijiao button {
		width: 600rpx;
		background-color: #0079FE;
		position: fixed;
		bottom: 0;
		height: 90rpx;
	}
	
</style>
